﻿using System;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.WebPartPages;

namespace CSCV.Group1.NewsAnnouncement.ListNews
{
    [ToolboxItemAttribute(false)]
    public class ListNews : System.Web.UI.WebControls.WebParts.WebPart
    {
        // Visual Studio might automatically update this path when you change the Visual Web Part project item.
        private const string _ascxPath = @"~/_CONTROLTEMPLATES/CSCV.Group1.NewsAnnouncement/ListNews/ListNewsUserControl.ascx";
        //[Browsable(true), Category("Miscellaneous"),
        //DefaultValue("Detail.aspx"),
        //WebPartStorage(Storage.Personal),
        //FriendlyName("Detail Page"), Description("Detail Page")]
        //public string Text
        //{
        //    get
        //    {
        //        return Text;
        //    }
        //    set
        //    {
        //        Text = value;
        //    }
        //}
        protected override void CreateChildControls()
        {
            Control control = Page.LoadControl(_ascxPath);
            ListNewsUserControl webpartUC = (ListNewsUserControl)control;
            webpartUC.showTop = true;
            webpartUC.numTop = 4;
            Controls.Add(control);
        }
    }
}
